#pragma once
#include "DLinearMotor.h"
#include "../DWorld.h"
#include "../DVector3.h"
#include "DJointGroup.h"

namespace Skill
{
	namespace Ode
	{
		namespace Joints
		{			
			DLinearMotor::DLinearMotor(DWorld^ world , DJointGroup^ group)
				:DJoint(world,group)
			{
				dWorldID w = world? world->_This : NULL;
				dJointGroupID g = group? group->_This : NULL;
				_SetPointer(dJointCreateLMotor(w,g),true);
			}
			int DLinearMotor::NumAxes::get()
			{
				return dJointGetLMotorNumAxes(_This);
			}
			void DLinearMotor::NumAxes::set(int value)
			{
				dJointSetLMotorNumAxes(_This,value);
			}

			void DLinearMotor::SetAxis(int anum, int rel, dReal x, dReal y, dReal z)
			{
				dJointSetLMotorAxis(_This,anum,rel,x,y,z);
			}
			void DLinearMotor::SetAxis(int anum, int rel, DVector3^ axis)
			{
				dJointSetLMotorAxis(_This,anum,rel,axis->_This[0] ,axis->_This[1],axis->_This[2]);
			}

			void DLinearMotor::SetParam(DJointParameters parameter, dReal value)
			{
				dJointSetLMotorParam(_This,(int)parameter, value);
			}
			dReal DLinearMotor::GetParam(DJointParameters parameter)
			{
				return dJointGetLMotorParam(_This,(int)parameter);
			}

			void DLinearMotor::GetAxis(int anum, DVector3^ result)
			{
				dJointGetLMotorAxis(_This,anum,result->_This);
			}
		}
	}
}